<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="public/css.css" rel="stylesheet" type="text/css" />
<title>web2</title>
</head>

<body>
    <?php
require_once 'model/works.php';

$keyword = new Works();
$keyword->table_name = "works";
?>
<?php
if (!isset($_GET["page"]))
    $page = 1;
else
   $page = $_GET["page"];
$keywords = $keyword->select($page);
$total = $keyword->countWords();
?>
    <div class="hinh"></div>
    <div class="menu">
        <ul>
            <li><a href="#"> menu</a></li>
            <li><a href="#"> menu</a></li>
            <li><a href="#"> menu</a></li>
            <li><a href="#"> menu</a></li>
            <li><a href="#"> menu</a></li>
        </ul>
           <div class="thanh"></div>
        </div>
 
<table border="1px" style="clear: both;">
    <tr  id="tr" >
        <td>Id</td>
        <td>Name</td>
        <td>Description</td>
    </tr>
    <?php foreach ($keywords as $keywords_n): ?>
        <tr>
            <td> <?php echo $keywords_n["id"] ; ?></td>
            <td><?php echo $keywords_n["name"] ; ?></td>
            <td><?php echo substr($keywords_n['description'], 0, 100) ; ?></td>
        </tr>
    <?php endforeach; ?>

</table>
<?php for ($i = 1; $i <= $total / PAGE; $i++): ?>
    <nav>
        <ul>
            <li>
                <a href="index1.php?page=<?php echo $i ?>">
                    <?php echo $i ?>
                </a>
            </li>
        </ul>
    </nav>
<?php endfor; ?>

</body>
</html>